[FORMAT "WCOFF"]
[INSTRSET "i486p"]
[OPTIMIZE 1]
[OPTION 1]
[BITS 32]
	EXTERN	_table_rgb.0
	EXTERN	_io_load_eflags
	EXTERN	_io_cli
	EXTERN	_io_out8
	EXTERN	_io_store_eflags
	EXTERN	_file_search
	EXTERN	_memman_alloc_4k
	EXTERN	_file_loadfile2
	EXTERN	_info_JPEG
	EXTERN	_decode0_JPEG
	EXTERN	_file_readfat
	EXTERN	_memman_free_4k
	EXTERN	_task_now
	EXTERN	_hankaku
[FILE "graphic.c"]
[SECTION .data]
_table_rgb.0:
	DB	0
	DB	0
	DB	0
	DB	-1
	DB	0
	DB	0
	DB	0
	DB	-1
	DB	0
	DB	-1
	DB	-1
	DB	0
	DB	0
	DB	0
	DB	-1
	DB	-1
	DB	0
	DB	-1
	DB	0
	DB	-1
	DB	-1
	DB	-1
	DB	-1
	DB	-1
	DB	-58
	DB	-58
	DB	-58
	DB	-124
	DB	0
	DB	0
	DB	0
	DB	-124
	DB	0
	DB	-124
	DB	-124
	DB	0
	DB	0
	DB	0
	DB	-124
	DB	-124
	DB	0
	DB	-124
	DB	0
	DB	-124
	DB	-124
	DB	-124
	DB	-124
	DB	-124
[SECTION .text]
	GLOBAL	_init_palette
_init_palette:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	SUB	ESP,676
	PUSH	_table_rgb.0
	PUSH	15
	PUSH	0
	CALL	_set_palette
	ADD	ESP,12
	MOV	DWORD [-672+EBP],0
	MOV	DWORD [-676+EBP],0
	MOV	DWORD [-680+EBP],0
L16:
	XOR	EDI,EDI
	XOR	ESI,ESI
	XOR	EBX,EBX
L15:
	XOR	EDX,EDX
	MOV	DWORD [-688+EBP],0
L14:
	MOV	EAX,DWORD [-680+EBP]
	MOV	CL,BYTE [-688+EBP]
	ADD	EAX,EBX
	ADD	EAX,EDX
	INC	EDX
	IMUL	EAX,EAX,3
	MOV	BYTE [-668+EBP+EAX*1],CL
	MOV	ECX,ESI
	MOV	BYTE [-667+EBP+EAX*1],CL
	MOV	CL,BYTE [-676+EBP]
	MOV	BYTE [-666+EBP+EAX*1],CL
	ADD	DWORD [-688+EBP],51
	CMP	EDX,5
	JLE	L14
	INC	EDI
	ADD	ESI,51
	ADD	EBX,6
	CMP	EDI,5
	JLE	L15
	INC	DWORD [-672+EBP]
	ADD	DWORD [-676+EBP],51
	ADD	DWORD [-680+EBP],36
	CMP	DWORD [-672+EBP],5
	JLE	L16
	LEA	EAX,DWORD [-668+EBP]
	PUSH	EAX
	PUSH	231
	PUSH	16
	CALL	_set_palette
	LEA	ESP,DWORD [-12+EBP]
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
	GLOBAL	_set_palette
_set_palette:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	PUSH	ECX
	MOV	EBX,DWORD [8+EBP]
	MOV	EDI,DWORD [12+EBP]
	MOV	ESI,DWORD [16+EBP]
	CALL	_io_load_eflags
	MOV	DWORD [-16+EBP],EAX
	CALL	_io_cli
	PUSH	EBX
	PUSH	968
	CALL	_io_out8
	CMP	EBX,EDI
	POP	EAX
	POP	EDX
	JLE	L28
L30:
	MOV	EAX,DWORD [-16+EBP]
	MOV	DWORD [8+EBP],EAX
	LEA	ESP,DWORD [-12+EBP]
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	JMP	_io_store_eflags
L28:
	MOV	AL,BYTE [ESI]
	INC	EBX
	SHR	AL,2
	MOVZX	EAX,AL
	PUSH	EAX
	PUSH	969
	CALL	_io_out8
	MOV	AL,BYTE [1+ESI]
	SHR	AL,2
	MOVZX	EAX,AL
	PUSH	EAX
	PUSH	969
	CALL	_io_out8
	MOV	AL,BYTE [2+ESI]
	SHR	AL,2
	ADD	ESI,3
	MOVZX	EAX,AL
	PUSH	EAX
	PUSH	969
	CALL	_io_out8
	ADD	ESP,24
	CMP	EBX,EDI
	JLE	L28
	JMP	L30
	GLOBAL	_boxfill8
_boxfill8:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	MOV	ECX,DWORD [24+EBP]
	PUSH	EBX
	MOV	EDI,DWORD [28+EBP]
	CMP	ECX,DWORD [32+EBP]
	JG	L43
	MOV	EBX,DWORD [12+EBP]
	IMUL	EBX,ECX
L41:
	MOV	EDX,DWORD [20+EBP]
	CMP	EDX,EDI
	JG	L45
	LEA	EAX,DWORD [EDX+EBX*1]
	MOV	ESI,DWORD [8+EBP]
	LEA	EAX,DWORD [ESI+EAX*4]
L40:
	MOV	ESI,DWORD [16+EBP]
	INC	EDX
	MOV	DWORD [EAX],ESI
	ADD	EAX,4
	CMP	EDX,EDI
	JLE	L40
L45:
	INC	ECX
	ADD	EBX,DWORD [12+EBP]
	CMP	ECX,DWORD [32+EBP]
	JLE	L41
L43:
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
[SECTION .data]
LC0:
	DB	"back.jpg",0x00
[SECTION .text]
	GLOBAL	_read_wallpaper_32
_read_wallpaper_32:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	SUB	ESP,48
	PUSH	224
	PUSH	1058304
	PUSH	LC0
	CALL	_file_search
	ADD	ESP,12
	MOV	EBX,EAX
	OR	EAX,-1
	TEST	EBX,EBX
	JE	L46
	MOV	EAX,DWORD [28+EBX]
	PUSH	EAX
	MOV	DWORD [-32+EBP],EAX
	PUSH	3932160
	CALL	_memman_alloc_4k
	LEA	EAX,DWORD [-32+EBP]
	PUSH	DWORD [20+EBP]
	PUSH	EAX
	MOVZX	EAX,WORD [26+EBX]
	PUSH	EAX
	CALL	_file_loadfile2
	PUSH	65536
	PUSH	3932160
	MOV	ESI,EAX
	CALL	_memman_alloc_4k
	PUSH	ESI
	PUSH	DWORD [-32+EBP]
	MOV	EBX,EAX
	LEA	EAX,DWORD [-28+EBP]
	PUSH	EAX
	PUSH	EBX
	CALL	_info_JPEG
	MOV	EAX,DWORD [-16+EBP]
	IMUL	EAX,DWORD [-20+EBP]
	SAL	EAX,2
	ADD	ESP,44
	PUSH	EAX
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	0
	PUSH	EAX
	MOV	DWORD [-40+EBP],EAX
	PUSH	4
	PUSH	ESI
	PUSH	DWORD [-32+EBP]
	PUSH	EBX
	CALL	_decode0_JPEG
	ADD	ESP,32
	MOV	EAX,DWORD [-20+EBP]
	MOV	EDX,DWORD [12+EBP]
	SUB	EDX,EAX
	MOV	DWORD [-44+EBP],EAX
	MOV	EAX,EDX
	MOV	ECX,2
	CDQ
	IDIV	ECX
	MOV	EDX,DWORD [-16+EBP]
	MOV	DWORD [-48+EBP],EAX
	SUB	DWORD [16+EBP],EDX
	MOV	DWORD [-52+EBP],EDX
	MOV	DWORD [-36+EBP],0
	MOV	EAX,DWORD [16+EBP]
	CDQ
	IDIV	ECX
	MOV	EDX,DWORD [-52+EBP]
	MOV	DWORD [-56+EBP],EAX
	CMP	DWORD [-36+EBP],EDX
	JGE	L46
L57:
	XOR	EDI,EDI
	MOV	ESI,DWORD [-44+EBP]
	CMP	EDI,ESI
	JGE	L61
L56:
	MOV	EBX,DWORD [-56+EBP]
	MOV	EDX,DWORD [-36+EBP]
	ADD	EBX,DWORD [-36+EBP]
	MOV	EAX,DWORD [-48+EBP]
	IMUL	EDX,ESI
	IMUL	EBX,DWORD [12+EBP]
	ADD	EAX,EDI
	ADD	EDX,EDI
	ADD	EBX,EAX
	INC	EDI
	MOV	DWORD [-60+EBP],EBX
	MOV	EBX,DWORD [-40+EBP]
	MOVZX	EAX,BYTE [1+EBX+EDX*4]
	MOVZX	ECX,BYTE [EBX+EDX*4]
	SAL	EAX,8
	OR	ECX,EAX
	MOVZX	EAX,BYTE [2+EBX+EDX*4]
	SAL	EAX,16
	MOV	EDX,DWORD [24+EBP]
	OR	ECX,EAX
	CMP	EDI,ESI
	MOV	EAX,DWORD [-60+EBP]
	MOV	DWORD [EDX+EAX*4],ECX
	JL	L56
L61:
	MOV	EBX,DWORD [-52+EBP]
	INC	DWORD [-36+EBP]
	CMP	DWORD [-36+EBP],EBX
	JL	L57
L46:
	LEA	ESP,DWORD [-12+EBP]
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
	GLOBAL	_init_screen8
_init_screen8:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	MOV	EDI,DWORD [12+EBP]
	PUSH	11520
	MOV	ESI,DWORD [16+EBP]
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	1049088
	MOV	EBX,EAX
	PUSH	EAX
	CALL	_file_readfat
	PUSH	DWORD [8+EBP]
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	PUSH	LC0
	CALL	_read_wallpaper_32
	ADD	ESP,36
	PUSH	11520
	PUSH	EBX
	PUSH	3932160
	CALL	_memman_free_4k
	LEA	EAX,DWORD [-1+ESI]
	PUSH	EAX
	SUB	ESI,28
	LEA	EAX,DWORD [-1+EDI]
	PUSH	EAX
	PUSH	ESI
	PUSH	0
	PUSH	16119285
	PUSH	EDI
	PUSH	DWORD [8+EBP]
	CALL	_boxfill8
	LEA	ESP,DWORD [-12+EBP]
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
	GLOBAL	_putfont8
_putfont8:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	XOR	ESI,ESI
	PUSH	EBX
	MOV	EDI,DWORD [28+EBP]
	MOV	EBX,DWORD [24+EBP]
L76:
	MOV	EAX,DWORD [20+EBP]
	MOV	EDX,DWORD [8+EBP]
	ADD	EAX,ESI
	IMUL	EAX,DWORD [12+EBP]
	ADD	EAX,DWORD [16+EBP]
	LEA	ECX,DWORD [EDX+EAX*4]
	MOV	DL,BYTE [ESI+EDI*1]
	TEST	DL,DL
	JNS	L68
	MOV	DWORD [ECX],EBX
L68:
	MOV	AL,DL
	AND	EAX,64
	TEST	AL,AL
	JE	L69
	MOV	DWORD [4+ECX],EBX
L69:
	MOV	AL,DL
	AND	EAX,32
	TEST	AL,AL
	JE	L70
	MOV	DWORD [8+ECX],EBX
L70:
	MOV	AL,DL
	AND	EAX,16
	TEST	AL,AL
	JE	L71
	MOV	DWORD [12+ECX],EBX
L71:
	MOV	AL,DL
	AND	EAX,8
	TEST	AL,AL
	JE	L72
	MOV	DWORD [16+ECX],EBX
L72:
	MOV	AL,DL
	AND	EAX,4
	TEST	AL,AL
	JE	L73
	MOV	DWORD [20+ECX],EBX
L73:
	MOV	AL,DL
	AND	EAX,2
	TEST	AL,AL
	JE	L74
	MOV	DWORD [24+ECX],EBX
L74:
	AND	EDX,1
	TEST	DL,DL
	JE	L66
	MOV	DWORD [28+ECX],EBX
L66:
	INC	ESI
	CMP	ESI,15
	JLE	L76
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
	GLOBAL	_putfont32
_putfont32:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	SUB	ESP,12
	MOV	EAX,DWORD [20+EBP]
	MOV	EDX,DWORD [8+EBP]
	IMUL	EAX,DWORD [12+EBP]
	ADD	EAX,DWORD [16+EBP]
	MOV	DWORD [-20+EBP],1
	LEA	EDI,DWORD [EDX+EAX*4]
	MOV	DWORD [-16+EBP],0
L96:
	XOR	EBX,EBX
L89:
	MOV	ECX,DWORD [28+EBP]
	MOV	EAX,DWORD [-16+EBP]
	MOVSX	EDX,BYTE [EAX+ECX*1]
	MOV	EAX,128
	MOV	CL,BL
	SAR	EAX,CL
	TEST	EDX,EAX
	JE	L86
	MOV	EDX,2
	MOV	EAX,DWORD [-16+EBP]
	MOV	ECX,EDX
	CDQ
	IDIV	ECX
	MOV	EAX,DWORD [24+EBP]
	LEA	EDX,DWORD [EBX+EDX*8]
	MOV	DWORD [EDI+EDX*4],EAX
L86:
	INC	EBX
	CMP	EBX,7
	JLE	L89
	XOR	EBX,EBX
L94:
	MOV	EDX,2
	MOV	EAX,DWORD [-16+EBP]
	MOV	ECX,EDX
	CDQ
	IDIV	ECX
	SAL	EDX,3
	LEA	ECX,DWORD [EBX+EDX*1]
	SUB	EDX,EBX
	INC	EBX
	MOV	ESI,DWORD [EDI+ECX*4]
	MOV	EAX,DWORD [28+EDI+EDX*4]
	MOV	DWORD [EDI+ECX*4],EAX
	CMP	EBX,3
	MOV	DWORD [28+EDI+EDX*4],ESI
	JLE	L94
	TEST	DWORD [-16+EBP],1
	JE	L82
	MOV	EAX,DWORD [20+EBP]
	MOV	EDX,DWORD [8+EBP]
	ADD	EAX,DWORD [-20+EBP]
	INC	DWORD [-20+EBP]
	IMUL	EAX,DWORD [12+EBP]
	ADD	EAX,DWORD [16+EBP]
	LEA	EDI,DWORD [EDX+EAX*4]
L82:
	INC	DWORD [-16+EBP]
	CMP	DWORD [-16+EBP],15
	JLE	L96
	MOV	DWORD [-16+EBP],0
L113:
	XOR	EBX,EBX
L106:
	MOV	ECX,DWORD [32+EBP]
	MOV	EAX,DWORD [-16+EBP]
	MOVSX	EDX,BYTE [EAX+ECX*1]
	MOV	EAX,128
	MOV	CL,BL
	SAR	EAX,CL
	TEST	EDX,EAX
	JE	L103
	MOV	EDX,2
	MOV	EAX,DWORD [-16+EBP]
	MOV	ECX,EDX
	CDQ
	IDIV	ECX
	MOV	EAX,DWORD [24+EBP]
	LEA	EDX,DWORD [EBX+EDX*8]
	MOV	DWORD [EDI+EDX*4],EAX
L103:
	INC	EBX
	CMP	EBX,7
	JLE	L106
	XOR	EBX,EBX
L111:
	MOV	EDX,2
	MOV	EAX,DWORD [-16+EBP]
	MOV	ECX,EDX
	CDQ
	IDIV	ECX
	SAL	EDX,3
	LEA	ECX,DWORD [EBX+EDX*1]
	SUB	EDX,EBX
	INC	EBX
	MOV	ESI,DWORD [EDI+ECX*4]
	MOV	EAX,DWORD [28+EDI+EDX*4]
	MOV	DWORD [EDI+ECX*4],EAX
	CMP	EBX,3
	MOV	DWORD [28+EDI+EDX*4],ESI
	JLE	L111
	TEST	DWORD [-16+EBP],1
	JE	L99
	MOV	EAX,DWORD [20+EBP]
	MOV	EDX,DWORD [8+EBP]
	ADD	EAX,DWORD [-20+EBP]
	INC	DWORD [-20+EBP]
	IMUL	EAX,DWORD [12+EBP]
	ADD	EAX,DWORD [16+EBP]
	LEA	EDI,DWORD [EDX+EAX*4]
L99:
	INC	DWORD [-16+EBP]
	CMP	DWORD [-16+EBP],15
	JLE	L113
	ADD	ESP,12
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
	GLOBAL	_putfonts8_asc
_putfonts8_asc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	PUSH	EBX
	PUSH	EBX
	MOV	EDI,DWORD [16+EBP]
	MOV	ESI,DWORD [28+EBP]
	CALL	_task_now
	MOV	DWORD [-16+EBP],EAX
	MOV	EAX,DWORD [4072]
	MOV	EDX,DWORD [-16+EBP]
	MOV	DWORD [-20+EBP],EAX
	CMP	BYTE [188+EDX],0
	JNE	L127
	CMP	BYTE [ESI],0
	JNE	L132
L127:
	MOV	ECX,DWORD [-16+EBP]
	CMP	BYTE [188+ECX],1
	JE	L163
L133:
	MOV	ECX,DWORD [-16+EBP]
	CMP	BYTE [188+ECX],2
	JE	L164
L126:
	LEA	ESP,DWORD [-12+EBP]
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
L164:
	CMP	BYTE [ESI],0
	JE	L126
L159:
	MOV	EDX,DWORD [-16+EBP]
	MOV	AL,BYTE [189+EDX]
	TEST	AL,AL
	JNE	L155
	MOV	DL,BYTE [ESI]
	LEA	EAX,DWORD [95+EDX]
	CMP	AL,93
	JA	L156
	MOV	ECX,DWORD [-16+EBP]
	MOV	BYTE [189+ECX],DL
L158:
	INC	ESI
	ADD	EDI,8
	CMP	BYTE [ESI],0
	JNE	L159
	JMP	L126
L156:
	MOVZX	EAX,DL
	SAL	EAX,4
	ADD	EAX,_hankaku
	PUSH	EAX
	PUSH	DWORD [24+EBP]
	PUSH	DWORD [20+EBP]
	PUSH	EDI
	PUSH	DWORD [12+EBP]
	PUSH	DWORD [8+EBP]
	CALL	_putfont8
	ADD	ESP,24
	JMP	L158
L155:
	MOVZX	EAX,AL
	IMUL	EAX,EAX,94
	MOVZX	EDX,BYTE [ESI]
	MOV	ECX,DWORD [-16+EBP]
	LEA	EAX,DWORD [-15295+EDX+EAX*1]
	MOV	BYTE [189+ECX],0
	SAL	EAX,5
	MOV	EDX,DWORD [-20+EBP]
	ADD	EDX,EAX
	LEA	EAX,DWORD [16+EDX]
	PUSH	EAX
	LEA	EAX,DWORD [-8+EDI]
	PUSH	EDX
	PUSH	DWORD [24+EBP]
	PUSH	DWORD [20+EBP]
	PUSH	EAX
	PUSH	DWORD [12+EBP]
	PUSH	DWORD [8+EBP]
	CALL	_putfont32
	ADD	ESP,28
	JMP	L158
L163:
	CMP	BYTE [ESI],0
	JE	L133
L149:
	MOV	EAX,DWORD [-16+EBP]
	MOV	DL,BYTE [189+EAX]
	TEST	DL,DL
	JNE	L138
	MOV	DL,BYTE [ESI]
	LEA	EAX,DWORD [127+EDX]
	CMP	AL,30
	JBE	L140
	LEA	EAX,DWORD [32+EDX]
	CMP	AL,28
	JA	L139
L140:
	MOV	ECX,DWORD [-16+EBP]
	MOV	BYTE [189+ECX],DL
L142:
	INC	ESI
	ADD	EDI,8
	CMP	BYTE [ESI],0
	JNE	L149
	JMP	L133
L139:
	MOVZX	EAX,DL
	SAL	EAX,4
	ADD	EAX,DWORD [-20+EBP]
	PUSH	EAX
	PUSH	DWORD [24+EBP]
	PUSH	DWORD [20+EBP]
	PUSH	EDI
	PUSH	DWORD [12+EBP]
	PUSH	DWORD [8+EBP]
	CALL	_putfont8
	ADD	ESP,24
	JMP	L142
L138:
	LEA	EAX,DWORD [127+EDX]
	CMP	AL,30
	JA	L143
	MOVZX	EAX,DL
	LEA	ECX,DWORD [-258+EAX+EAX*1]
L144:
	MOV	DL,BYTE [ESI]
	LEA	EAX,DWORD [-64+EDX]
	CMP	AL,62
	JA	L145
	MOVZX	EAX,DL
	SUB	EAX,64
L146:
	IMUL	EBX,ECX,94
	MOV	EDX,DWORD [-16+EBP]
	ADD	EBX,EAX
	SAL	EBX,5
	LEA	EAX,DWORD [-8+EDI]
	MOV	BYTE [189+EDX],0
	ADD	EBX,DWORD [-20+EBP]
	LEA	EDX,DWORD [4096+EBX]
	ADD	EBX,4112
	PUSH	EDX
	PUSH	DWORD [24+EBP]
	PUSH	DWORD [20+EBP]
	PUSH	EAX
	PUSH	DWORD [12+EBP]
	PUSH	DWORD [8+EBP]
	CALL	_putfont8
	PUSH	EBX
	PUSH	DWORD [24+EBP]
	PUSH	DWORD [20+EBP]
	PUSH	EDI
	PUSH	DWORD [12+EBP]
	PUSH	DWORD [8+EBP]
	CALL	_putfont8
	ADD	ESP,48
	JMP	L142
L145:
	LEA	EAX,DWORD [-128+EDX]
	CMP	AL,30
	JA	L147
	MOVZX	EAX,DL
	SUB	EAX,65
	JMP	L146
L147:
	MOVZX	EAX,DL
	SUB	EAX,159
	INC	ECX
	JMP	L146
L143:
	MOVZX	EAX,DL
	LEA	ECX,DWORD [-386+EAX+EAX*1]
	JMP	L144
L132:
	MOVZX	EAX,BYTE [ESI]
	SAL	EAX,4
	INC	ESI
	ADD	EAX,_hankaku
	PUSH	EAX
	PUSH	DWORD [24+EBP]
	PUSH	DWORD [20+EBP]
	PUSH	EDI
	ADD	EDI,8
	PUSH	DWORD [12+EBP]
	PUSH	DWORD [8+EBP]
	CALL	_putfont8
	ADD	ESP,24
	CMP	BYTE [ESI],0
	JNE	L132
	JMP	L127
[SECTION .data]
_cursor.1:
	DB	"*..............."
	DB	"**.............."
	DB	"*O*............."
	DB	"*OO*............"
	DB	"*OOO*..........."
	DB	"*OOOO*.........."
	DB	"*OOOOO*........."
	DB	"*OOOOOO*........"
	DB	"*OOOOOOO*......."
	DB	"*OOOOOOOO*......"
	DB	"*OOOOO*****....."
	DB	"*OO**OO*........"
	DB	"*O*.*OO*........"
	DB	"**...*OO*......."
	DB	"*....*OO*......."
	DB	"......**........"
[SECTION .text]
	GLOBAL	_init_mouse_cursor8
_init_mouse_cursor8:
	PUSH	EBP
	XOR	ECX,ECX
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	MOV	EDI,DWORD [12+EBP]
	MOV	ESI,DWORD [8+EBP]
	XOR	EBX,EBX
L178:
	XOR	EDX,EDX
L177:
	LEA	EAX,DWORD [EDX+ECX*1]
	CMP	BYTE [_cursor.1+EAX],42
	JE	L183
L174:
	CMP	BYTE [_cursor.1+EAX],79
	JE	L184
L175:
	CMP	BYTE [_cursor.1+EAX],46
	JE	L185
L172:
	INC	EDX
	CMP	EDX,15
	JLE	L177
	INC	EBX
	ADD	ECX,16
	CMP	EBX,15
	JLE	L178
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
L185:
	MOV	DWORD [ESI+EAX*4],EDI
	JMP	L172
L184:
	MOV	DWORD [ESI+EAX*4],16777215
	JMP	L175
L183:
	MOV	DWORD [ESI+EAX*4],0
	JMP	L174
	GLOBAL	_putblock8_8
_putblock8_8:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	XOR	ESI,ESI
	PUSH	EBX
	SUB	ESP,12
	CMP	ESI,DWORD [20+EBP]
	JGE	L198
	XOR	EDI,EDI
L196:
	XOR	EBX,EBX
	CMP	EBX,DWORD [16+EBP]
	JGE	L200
	MOV	EAX,DWORD [32+EBP]
	LEA	EAX,DWORD [EAX+EDI*4]
	MOV	DWORD [-20+EBP],EAX
L195:
	MOV	EAX,DWORD [28+EBP]
	MOV	EDX,DWORD [24+EBP]
	ADD	EAX,ESI
	ADD	EDX,EBX
	IMUL	EAX,DWORD [12+EBP]
	ADD	EAX,EDX
	MOV	ECX,DWORD [8+EBP]
	MOV	EDX,DWORD [-20+EBP]
	INC	EBX
	ADD	DWORD [-20+EBP],4
	MOV	EDX,DWORD [EDX]
	MOV	DWORD [ECX+EAX*4],EDX
	CMP	EBX,DWORD [16+EBP]
	JL	L195
L200:
	INC	ESI
	ADD	EDI,DWORD [36+EBP]
	CMP	ESI,DWORD [20+EBP]
	JL	L196
L198:
	ADD	ESP,12
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
